package com.wzqj.agent.common.exception;


import com.wzqj.agent.common.constant.ErrConstant;

// 不建议在此处重新定义ErrCode，会导致不好管理，推荐使用ErrConstant
//此处使用ErrConstant中的errCode。
//@Deprecated注释影响原有代码
public enum BusinessErrorType {

    SUCCESSFUL(0, "successful"),
    // 系统错误
    PARAM_ERROR(ErrConstant.ERRCODE_INVALID_PARAMETER, "参数错误"),
    UNKNOWN_EXP(ErrConstant.ERRCODE_ACTION_UNKNOW_EXP, "未知异常"),
    NOT_LOGIN(ErrConstant.ERRCODE_CHECKLOGIN_FAIL,"登录校验失败"),
    TOKEN_INVALID(ErrConstant.ERRCODE_TOKEN_INVALID,"appToken失效请重新登陆"),
    LOGIN_CAPTCHA_INVALID(ErrConstant.ERRORCODE_CAPTCHA_INVALID,"验证码已过期，请重获取验证码"),
    LOGIN_CAPTCHA_ERROR(ErrConstant.ERRORCODE_CAPTCHA_ERROR,"验证码不正确，请重获输入"),
    SOA_SEND_MSG_FAILURE(ErrConstant.SOA_SEND_SMS_FAILURE,"获取验证码失败"),
    LOGIN_TOKEN_GENE_ERROR(ErrConstant.ERRORCODE_TOKEN_GENERATE, "token生成失败"),
    LOGIN_TOKEN_SAVE_ERROR(ErrConstant.ERRORCODE_TOKEN_SAVE_ERROR, "token保存失败"),
    LOGIN_TOKEN_DELETE_ERROR(ErrConstant.ERRORCODE_TOKEN_DELETE_ERROR, "登出失败"),
    USER_GETIFNO_ERROR(ErrConstant.ERRORCODE_USER_GETIFNO_ERROR,"获取用户信息失败"),
    USER_UPDATE_ERROR(ErrConstant.ERRORCODE_USER_UPDATE_ERROR, "用户更新头像失败"),
    UPLOAD_FILE_NULL_ERROR(ErrConstant.ERRCODE_UPLOAD_FILE_NULL_ERROR,"文件不存在"),
    UPLOAD_FILE_TYPE_ERROR(ErrConstant.ERRCODE_UPLOAD_FILE_TYPE_ERROR,"文件类型不正确"),
    UPLOAD_FILE_SIZE_ERROR(ErrConstant.ERRCODE_UPLOAD_FILE_SIZE_ERROR,"图片尺寸超过规定尺寸"),
    UPLOAD_FILE_OUT_ERROR(ErrConstant.ERRCODE_UPLOAD_FILE_OUT_ERROR,"上传文件过大"),
    VERSION_INFO_CHECK_ERROR(ErrConstant.ERRCODE_VERSION_INFO_CHECK_ERROR,"检查版本更新失败"),
    MERCHANT_REGISTER_ERROR(ErrConstant.ERRORCODE_MERCHANT_REGISTER_ERROR,"商户注册失败"),
    QUALIFICATION_SEARCH_ERROR(ErrConstant.ERRORCODE_QUALIFICATION_SEARCH_ERROR,"资质查询失败"),
    MERCHANT_STORE_SEARCH_ERROR(ErrConstant.ERRCODE_MERCHANT_STORE_SEARCH_ERROR,"商户店铺查询失败"),
    MERCHANT_STORE_ADD_ERROR(ErrConstant.ERRCODE_MERCHANT_STORE_ADD_ERROR,"商户添加店铺失败"),
    MERCHANT_STORE_BIND_ERROR(ErrConstant.ERRCODE_MERCHANT_STORE_BIND_ERROR,"商户绑定店铺失败"),
    MERCHANT_STORE_UPDATE_ERROR(ErrConstant.ERRCODE_MERCHANT_STORE_UPDATE_ERROR,"商户更新店铺信息失败"),
    MERCHANT_STORE_BIZCLASSIFY_ERROR(ErrConstant.ERRCODE_MERCHANT_STORE_BIZCLASSIFY_ERROR,"获取行业列表失败"),
    DEVICE_BIND_ERROR(ErrConstant.ERRORCODE_DEVICE_BIND_ERROR,"设备En绑定到店铺失败"),
    UNKNOWN_ERROR(0x00FF, "未知系统错误");

    private long errCode;
    private String errMsg;

    private BusinessErrorType(long errCode, String errMsg) {
        this.errCode = errCode;
        this.errMsg = errMsg;
    }

    public long getErrCode() {
        return errCode;
    }

    public String getErrMsg() {
        return errMsg;
    }

}
